package main

import (
	_ "beegovuestudy/routers"
	"github.com/astaxie/beego"
	"github.com/beego/beego/v2/client/orm"
	_ "github.com/go-sql-driver/mysql"
)

func main() {
	if beego.BConfig.RunMode == "dev" {
		beego.BConfig.WebConfig.DirectoryIndex = true
		beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
		orm.Debug=true
		orm.RegisterDriver("mysql", orm.DRMySQL)
		orm.RegisterDataBase("default", "mysql", "root:why19991009@tcp(127.0.0.1:3306)/beegostudy?charset=utf8")
	    orm.RunSyncdb("default",true,true)
	}
	beego.Run()
}
